<template>
    <div>
      <div id="box">
        <div id="one" v-if="searchFocus">
          <img src='/static/img/logo.png' alt="">
          <input type="text" placeholder="搜索药品名/症状" @touchstart="searchshow">
          <div>
            <span class="fa fa-minus-square-o"></span>
            <p>扫码找药</p>
          </div>
        </div>
        <div id="two" v-if="!searchFocus">
          <img src="/static/img/close.png" alt="" @touchstart="searchshow">
          <input type="text" placeholder="搜索药品名/症状">
          <span class="fa fa-search"></span>
        </div>
        <div id="shade" v-if="!searchFocus">
          <p>大家都在搜</p>
          <div id="seach-info">
            <span>双11</span>
            <span>金戈</span>
            <span>欧兰宁</span>
            <span>开同</span>
            <span>万艾可伟哥</span>
            <span>参一胶囊</span>
            <span>恩必普</span>
            <span>维力青</span>
            <span>肾宝片</span>
            <span>希爱力</span>
          </div>
        </div>
      </div>
    </div>
</template>

<script>

    export default {
      data:function () {
        return {
          searchFocus:true
        }
      },
      methods:{
        searchshow:function () {
          this.searchFocus = !this.searchFocus
        }
      },

    }
</script>

<style scoped>
  #box{
    position: fixed;
    z-index: 20;
  }
  #one{
    display: flex;
    align-items: center;
    height: 100%;
  }
  p{
    margin: 0;
    font-size: 12px;
  }
  span{
    font-size: 18px;
  }
  input{
    height: 28px;
    margin-left: 8px;
    padding-left: 8px;
    border: none;
    /*border: solid 1px #eeeeee;*/
    border-radius: 2px;
  }
  #one div{
    text-align: center;
    position: absolute;
    right: 12px;
    color: white;
  }
  #box{
    background-color: rgb(0,71,156);
    height: 50px;
    width: 100vw;
    position: fixed;
    top: 0;
    right: 0;
  }
  #two{
    display: flex;
    align-items: center;
    height: 100%;
    width: 100vw;
  }
  #two img{
    margin-left: 8px;
  }
  #two span{
    position: absolute;
    right: 30px;
  }
  #two input{
    width: 300px;
  }
  #seach-info{
    background-color: white;
  }
  #seach-info span{
    font-size: 12px;
    padding: 0 12px;
    display: inline-block;
    height: 24px;
    line-height: 24px;
    border: solid 1px lightslategray;
    margin: 6px 6px;
    border-radius: 12px;
    color: #333333;
  }
  #shade{
    background-color: #eeeeee;
    height: calc(100vh - 50px);
    width: 100vw;
  }
  #shade p{
    font-size: 14px;
    margin: 0 4px;
    padding: 4px 0;
  }
</style>
